Skip to content

Building Tungsten Fabric for Windows

Dependencies

Machine with Windows 10 and installed updates is required.

  1. Enable .Net Framework 3.5 Windows Feature:

    Enable-WindowsOptionalFeature -Online -FeatureName NetFX3 -All
    
  2. Install VS2015 (any version).

  3. Install Windows SDK and WDK version 15063 (for Windows 10 version 1703).
  4. Create environment variable MSBUILD pointing to MSBuild.exe, eg. C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
  5. Install Chocolatey:

    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    
  6. Install Pythons and required libraries:

    choco install python3
    py -3 -m pip install wheel
    py -3 -m pip install scons
    choco install python2 --version=2.7.13
    py -2 -m pip install lxml
    
  7. Install Git:

    choco install git
    
  8. Install GNU utilities:

    choco install gnuwin32-coreutils.install
    choco install patch
    choco install make
    choco install vim
    choco install winflexbison3
    Copy-Item C:\ProgramData\chocolatey\bin\win_flex.exe C:\ProgramData\chocolatey\bin\flex.exe
    Copy-Item C:\ProgramData\chocolatey\bin\win_bison.exe C:\ProgramData\chocolatey\bin\bison.exe
    
  9. Add GNU utils directory to PATH env var, eg. C:\Program Files (x86)\GnuWin32\bin

  10. Install CMake:

    choco install CMake --install-arguments='ADD_CMAKE_TO_PATH=System'
    
  11. Install WiX:

    choco install wixtoolset
    
  12. Add WiX install directory to PATH env var, eg. C:\Program Files (x86)\WiX Toolset v3.11\bin\

  13. Install Boost:

    choco install boost-msvc-14 --version 1.62.0 --source https://www.myget.org/F/boost-msvc/api/v2
    
  14. Add Boost directory to INCLUDE env var (create this variable if it doesn't exist), eg. C:\local\boost_1_62

  15. Create env var BOOST_ROOT pointing to Boost directory, eg. C:\local\boost_1_62
  16. Install OpenSSL:

    choco install win-openssl --version 1.0.2-r --source https://www.myget.org/F/openssl/api/v2
    
  17. Add OpenSSL include directory to INCLUDE env var (create this variable if it doesn't exist), eg. C:\OpenSSL-Win64\include

  18. Create env var OPENSSL_ROOT pointing to OpenSSL directory, eg. C:\OpenSSL-Win64
  19. Install Visual C++ Redistributable Packages for Visual Studio 2013 (for OpenSSL):
    choco install vcredist2013
    

Setting up repositories

git clone https://review.opencontrail.org/Juniper/contrail-api-client src\contrail-api-client
git clone https://review.opencontrail.org/Juniper/contrail-build tools\build
git clone https://review.opencontrail.org/Juniper/contrail-common src\contrail-common
git clone https://review.opencontrail.org/Juniper/contrail-controller controller
git clone https://review.opencontrail.org/Juniper/contrail-third-party third_party
git clone https://review.opencontrail.org/Juniper/contrail-vrouter vrouter
git clone https://review.opencontrail.org/Juniper/contrail-windows windows
cp tools/build/SConstruct ./

cd third_party
py fetch_packages.py

Compiling

For vRouter:

scons vrouter

For vRouter Agent:

scons -j <nr of threads> contrail-vrouter-agent.msi

For Node Manager:

$packages = @(
    "database:node_mgr",
    "build/debug/sandesh/common/dist",
    "sandesh/library/python:pysandesh",
    "vrouter:node_mgr",
    "contrail-nodemgr"
)
scons -j <nr of threads> @packages

Known issues

  1. Issue with wdf

    Solution:

    Remove-Item -Recurse -Force "C:\Program Files (x86)\Windows Kits\10\Include\wdf"
    

    Read more here.

  2. Issue with Microsoft.Build.Tasks.v12.0.dll

    Solution:

    cd $EWDKPath\Program Files\MSBuild\14.0\Bin\amd64
    cp Microsoft.Build.Tasks.Core.dll Microsoft.Build.Tasks.v12.0.dll